package com.basin.admin.pojo.dto;

import com.basin.common.core.validate.ValidateGroup;
import com.basin.common.mybatisplus.base.BasePage;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

/**
 * @author: Sam ZHONG | sammy1997@aliyun.com
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "前端应用请求体")
public class FrontAppDTO extends BasePage {
    @NotNull(message = "数据id不能为空",
            groups = {ValidateGroup.Update.class, ValidateGroup.Delete.class})
    @Schema(description = "主键id")
    private Long id;
    @NotBlank(message = "应用编码不能为空",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class, ValidateGroup.Delete.class})
    @Schema(description = "应用编码")
    private String code;
    @NotBlank(message = "应用名称不能为空",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    @Schema(description = "应用名称")
    private String name;
    @Schema(description = "描述")
    private String description;
    @NotBlank(message = "应用URL不能为空",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    @Schema(description = "应用URL")
    private String url;
    @NotBlank(message = "应用基础路径不能为空",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    @Schema(description = "应用基础路径")
    private String baseRouteUrl;
    @Range(min = 0, max = 1, message = "在线状态只能是0或1",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    @NotNull(message = "在线状态编码不能为空",
            groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    @Schema(description = "在线状态编码")
    private Integer online;
}
